class Person:
    def __init__(self,name,weight):
        self.name = name
        self.weight = weight
    def __str__(self):
        return f"姓名：{self.name}，体重：{self.weight}kg"

    def run(self):
        print("跑步 3 km，体重减少了")
        self.weight -= 0.5
    def eat(self):
        self.weight += 1

xm = Person("小明",78.0)
print(xm)
xm.run()
print(xm)
xm.eat()
print(xm)


